package cz.su.pod.ksocializer.client.ui.widget;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.Widget;

public class CharCounter extends Composite {

	private static CharCounterUiBinder uiBinder = GWT
			.create(CharCounterUiBinder.class);

	interface CharCounterUiBinder extends UiBinder<Widget, CharCounter> {
	}

	@UiField InlineLabel currentCharacters;
	@UiField InlineLabel maxCharacters;
	
	public CharCounter() {
		initWidget(uiBinder.createAndBindUi(this));
		setCurrentCharacters(0);
		setMaxCharacters(0);
	}		
	
	public int getCurrentCharacters() {
		return Integer.valueOf(currentCharacters.getText());
	}
	
	public void setCurrentCharacters(int count) {
		currentCharacters.setText(String.valueOf(count));
	}
	
	public int getMaxCharacters() {
		return Integer.valueOf(maxCharacters.getText());
	}
	
	public void setMaxCharacters(int count) {
		maxCharacters.setText(String.valueOf(count));
	}
}
